package com.hex.ds.hdtp.core.web.script.test.controller;

import com.hex.bigdata.hbda.annotation.Log;
import com.hex.ds.hdtp.core.app.script.test.service.IScriptDataTestSyncService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(tags = "04-脚本测试：数据对齐")
@RequestMapping("api/script/test/task")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ScriptDataTestSyncController {

    private final IScriptDataTestSyncService dataTestSyncService;

    @Log("带数据测试任务-数据对齐")
    @GetMapping(value = {"/data/sync/{pkId}"})
    @ApiOperation("带数据测试任务-数据对齐")
    public ResponseEntity dataSync(@PathVariable("pkId") String pkId) {
        dataTestSyncService.dataSync(pkId);
        return ResponseEntity.ok("操作成功");
    }
}
